package datastore.db.property;

/*
 * class ReferenceProperty(reference_class=None, verbose_name=None, collection_name=None, ...)

    A reference to another model instance. For example, a reference may indicate a many-to-one relationship between the model with the property and the model referenced by the property.

    reference_class is the model class of the model instance being referenced. If specified, only model instances of the class can be assigned to this property. If None, any model instance can be the value of this property.

    collection_name is the name of the property to give to the referenced model class whose value is a Query for all entities that reference the entity. If no collection_name is set, then modelname_set (with the name of the model in lowercase letters and "_set" added) is used.

    Note: collection_name must be set if there are multiple properties within the same model referencing the same model class. Otherwise, a DuplicatePropertyError will be raised when the default names are generated.

    ReferenceProperty automatically references and dereferences model instances as property values: A model instance can be assigned to a ReferenceProperty directly, and its key will be used. The ReferenceProperty value can be used as if it were a model instance, and the datastore entity will be fetched and the model instance created when it is first used in this way. Untouched reference properties do not query for unneeded data.

    class Author(db.Model):
      name = db.StringProperty()

    class Story(db.Model):
      author = db.ReferenceProperty(Author)

    story = db.get(story_key)
    author_name = story.author.name

    As with a Key value, it is possible for a reference property value to refer to a data entity that does not exist. If a referenced entity is deleted from the datastore, references to the entity are not updated. An application can explicitly db.get() the value of a ReferenceProperty (which is a Key) to test whether the referenced entity exists.

    Deleting an entity does not delete entities referred to by a ReferenceProperty.

    See also this introduction to reference properties.

    Value type: db.Key (see above)

 */
public @interface ReferenceProperty {

}
